var path = require('path')
var HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
    entry: {
        app: ['./src/app.js']
    },

    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'bundle.js'
    },

    module: {
        loaders: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                loader: 'babel-loader',
                query: {
                    presets: ['react', 'es2015']
                }
            },
            {
                test: /\.css$/,
                loader: 'style!css'
            },
            {
                test: /\.(jpg|png)$/,
                loader: 'file'
            },
            {
                test: /\.json$/,
                loader: 'json-loader'
            }
        ],

    },

    plugins: [
        new HtmlWebpackPlugin({
            title: 'gallery'
        })
    ]
}